// by Xeno

private ["_listin", "_no_lift", "_vehicle", "_position", "_enterer", "_exit_it", "_may_fly", "_type_enterer","_was_engineon"];

_listin = _this select 0;
_enterer = _listin select 2;
if (!local _enterer) exitWith {};

_no_lift = _this select 1;
_vehicle = _listin select 0;
_position = _listin select 1;

_was_engineon = isEngineOn _vehicle;

_exit_it = false;

if (!_exit_it && _position == "driver") then {
	if (_enterer == player) then {
		if (_no_lift == 0) then {
			if (d_chophud_on) then {
				player SetVariable ["d_hud_id", (_vehicle addAction [localize "MSG_DOM_VECHUDOFF" call XGreyText, "client\sethud.sqf",0,-1,false])];
			} else {
				player SetVariable ["d_hud_id", (_vehicle addAction [localize "MSG_DOM_VECHUDON" call XGreyText, "client\sethud.sqf",1,-1,false])];
			};
			// Turns off the inner ability to lift vehicles. We're using the Arty and Log instead.
			//[_vehicle] execVM "client\helilift.sqf";
		};
	};
};

if (_exit_it) exitWith {
	_enterer action["Eject",_vehicle];
	if (!_was_engineon && isEngineOn _vehicle) then {_vehicle engineOn false};
};